home *** CD-ROM | disk | FTP | other *** search
/ Micromanía: 150 Juegos 2010 / 150Juegos_16.iso / Shareware / Shape Smash / shape-smash.swf / scripts / Code / LIB / animators / _aj302.as next >
Encoding:
Text File  |  2010-05-14  |  2.2 KB  |  85 lines

  1. package Code.LIB.animators
  2. {
  3.    import Code.LIB._be548;
  4.    
  5.    public class _aj302 extends _do643
  6.    {
  7.       public static const ROTATE_AND_HIDE:int = 0;
  8.       
  9.       public static const ROTATE_AND_SHOW:int = 1;
  10.       
  11.       private static const stNone:int = 0;
  12.       
  13.       private static const stRotateShow:int = 1;
  14.       
  15.       private static const stRotateHide:int = 2;
  16.       
  17.       private var mode:int;
  18.       
  19.       private var state:int;
  20.       
  21.       public function _aj302(param1:_be548, param2:int)
  22.       {
  23.          super(param1);
  24.          this.mode = param2;
  25.          State = stNone;
  26.       }
  27.       
  28.       override public function _kx70() : Boolean
  29.       {
  30.          return state == stNone;
  31.       }
  32.       
  33.       override public function animate(param1:Object = null) : void
  34.       {
  35.          super.animate();
  36.          State = mode == ROTATE_AND_HIDE ? stRotateHide : stRotateShow;
  37.       }
  38.       
  39.       override public function onEnterFrame() : void
  40.       {
  41.          switch(state)
  42.          {
  43.             case stRotateShow:
  44.                target.rotation += 20;
  45.                if(target.scaleX < 1)
  46.                {
  47.                   target.scaleX = target.scaleY = target.scaleY + 0.06;
  48.                }
  49.                else if(target.rotation == 0)
  50.                {
  51.                   target.scaleX = target.scaleY = 1;
  52.                   State = stNone;
  53.                }
  54.                break;
  55.             case stRotateHide:
  56.                target.rotation -= 20;
  57.                if(target.scaleX > 0)
  58.                {
  59.                   target.scaleX = target.scaleY = target.scaleY - 0.09;
  60.                }
  61.                else if(target.rotation < 21)
  62.                {
  63.                   target.rotation = 0;
  64.                   target.scaleX = target.scaleY = 1;
  65.                   State = stNone;
  66.                }
  67.          }
  68.       }
  69.       
  70.       public function set State(param1:int) : void
  71.       {
  72.          this.state = param1;
  73.          switch(state)
  74.          {
  75.             case stRotateShow:
  76.                target.scaleX = target.scaleY = 0;
  77.                break;
  78.             case stRotateHide:
  79.                target.scaleX = target.scaleY = 1;
  80.          }
  81.       }
  82.    }
  83. }
  84.  
  85.